package top.toptimus.dto.saleStyle;

import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.constValue.StockInOutType;
import top.toptimus.dto.stock.StockInOutDetailDTO;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Data
@NoArgsConstructor
public class SaleStockInOutDetailDTO {
    private List<StockInOutDetailDTO> stockInOutDetailDTOSFactorySaleOut;   //  工厂销售出库
    private List<StockInOutDetailDTO> stockInOutDetailDTOSFactorySaleOutRecent; //  工厂最近14天销售出库
    private List<StockInOutDetailDTO> stockInOutDetailDTOSShopSaleOut;  //  门店销售出库
    private List<StockInOutDetailDTO> stockInOutDetailDTOSShopSaleOutRecent;    //  门店最近14天销售出库

    public SaleStockInOutDetailDTO(Map<String, List<StockInOutDetailDTO>> stringListMap) {
        if (stringListMap != null && !stringListMap.isEmpty()) {
            this.stockInOutDetailDTOSFactorySaleOut = stringListMap.containsKey(StockInOutType.FactorySaleOut) ? stringListMap.get(StockInOutType.FactorySaleOut) : new ArrayList<>();
            this.stockInOutDetailDTOSFactorySaleOutRecent = stringListMap.containsKey(StockInOutType.FactorySaleOut + "Recent") ? stringListMap.get(StockInOutType.FactorySaleOut + "Recent") : new ArrayList<>();
            this.stockInOutDetailDTOSShopSaleOut = stringListMap.containsKey(StockInOutType.ShopSaleOut) ? stringListMap.get(StockInOutType.ShopSaleOut) : new ArrayList<>();
            this.stockInOutDetailDTOSShopSaleOutRecent = stringListMap.containsKey(StockInOutType.ShopSaleOut + "Recent") ? stringListMap.get(StockInOutType.ShopSaleOut + "Recent") : new ArrayList<>();
        }
    }
}
